import service from '@/utils/request'

// @Tags Announcements
// @Summary 创建公告
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Announcements true "创建公告"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /announcements/createAnnouncements [post]
export const createAnnouncements = (data) => {
  return service({
    url: '/announcements/createAnnouncements',
    method: 'post',
    data
  })
}

// @Tags Announcements
// @Summary 删除公告
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Announcements true "删除公告"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /announcements/deleteAnnouncements [delete]
export const deleteAnnouncements = (params) => {
  return service({
    url: '/announcements/deleteAnnouncements',
    method: 'delete',
    params
  })
}

// @Tags Announcements
// @Summary 批量删除公告
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除公告"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /announcements/deleteAnnouncements [delete]
export const deleteAnnouncementsByIds = (params) => {
  return service({
    url: '/announcements/deleteAnnouncementsByIds',
    method: 'delete',
    params
  })
}

// @Tags Announcements
// @Summary 更新公告
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Announcements true "更新公告"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /announcements/updateAnnouncements [put]
export const updateAnnouncements = (data) => {
  return service({
    url: '/announcements/updateAnnouncements',
    method: 'put',
    data
  })
}

// @Tags Announcements
// @Summary 用id查询公告
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.Announcements true "用id查询公告"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /announcements/findAnnouncements [get]
export const findAnnouncements = (params) => {
  return service({
    url: '/announcements/findAnnouncements',
    method: 'get',
    params
  })
}

// @Tags Announcements
// @Summary 分页获取公告列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取公告列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /announcements/getAnnouncementsList [get]
export const getAnnouncementsList = (params) => {
  return service({
    url: '/announcements/getAnnouncementsList',
    method: 'get',
    params
  })
}
